package Service.impl;

import Service.IShopCartService;
import dao.IShopCartDao;
import dao.impl.ShopCartDaoImpl;
import pojo.Product;

import java.util.List;

public class ShopCartServiceImpl implements IShopCartService {
    private IShopCartDao shopCartDao=new ShopCartDaoImpl();
    @Override
    public void addProduct(Product product, int shopCartId, int number) {
        shopCartDao.addProduct(product,shopCartId,number);
    }

    @Override
    public void updateProduct(Product product, int shopCartId, int number) {
        shopCartDao.updateProduct(product,shopCartId,number);
    }

    @Override
    public void deleteProduct(Product product, int shopCartId) {
        shopCartDao.deleteProduct(product,shopCartId);
    }

    @Override
    public List<Product> findAll() {
        return shopCartDao.findAll();
    }

    @Override
    public List<Product> findByLikeName(String name) {
        return shopCartDao.findByLikeName(name);
    }
}
